package sgc.struc;

import java.util.Date;

public class MaterialPrice {

	private int code;
	private String mat_name;
	private int mat_code;
	private String company_name;
	private int company_code;
	private double price;
	private Date valid_from;
	public String getMat_name() {
		return mat_name;
	}
	public void setMat_name(String mat_name) {
		this.mat_name = mat_name;
	}
	public String getCompany_name() {
		return company_name;
	}
	public void setCompany_name(String company_name) {
		this.company_name = company_name;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public Date getValid_from() {
		return valid_from;
	}
	public void setValid_from(Date valid_from) {
		this.valid_from = valid_from;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public int getCompany_code() {
		return company_code;
	}
	public void setCompany_code(int company_code) {
		this.company_code = company_code;
	}
	public int getMat_code() {
		return mat_code;
	}
	public void setMat_code(int mat_code) {
		this.mat_code = mat_code;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + code;
		result = prime * result + company_code;
		result = prime * result
				+ ((company_name == null) ? 0 : company_name.hashCode());
		result = prime * result + mat_code;
		result = prime * result
				+ ((mat_name == null) ? 0 : mat_name.hashCode());
		long temp;
		temp = Double.doubleToLongBits(price);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result
				+ ((valid_from == null) ? 0 : valid_from.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MaterialPrice other = (MaterialPrice) obj;
		if (code != other.code)
			return false;
		if (company_code != other.company_code)
			return false;
		if (company_name == null) {
			if (other.company_name != null)
				return false;
		} else if (!company_name.equals(other.company_name))
			return false;
		if (mat_code != other.mat_code)
			return false;
		if (mat_name == null) {
			if (other.mat_name != null)
				return false;
		} else if (!mat_name.equals(other.mat_name))
			return false;
		if (Double.doubleToLongBits(price) != Double
				.doubleToLongBits(other.price))
			return false;
		if (valid_from == null) {
			if (other.valid_from != null)
				return false;
		} else if (!valid_from.equals(other.valid_from))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "MaterialPrice [code=" + code + ", mat_name=" + mat_name
				+ ", mat_code=" + mat_code + ", company_name=" + company_name
				+ ", company_code=" + company_code + ", price=" + price
				+ ", valid_from=" + valid_from + "]";
	}
	
}
